<?php
namespace app\api\controller;
use think\Controller;
use think\Request;
use think\File;

class Image extends Controller{
    public function upload() {
        $file = Request::instance()->file('file');
        //设定上传目录
        $info = $file->move('upload');
//        print_r($info);
        if($info && $info->getPathname()){
            return show(1, 'success', '/'.$info->getPathname());
        }
        return show(0, 'upload error');
    }
}